package com.example.makerspace.dao;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.makerspace.domain.ArtworkReviewDO;
import com.example.makerspace.domain.UserCompetitionRelationShipDO;
import com.example.makerspace.mapper.ArtworkReviewMapper;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
public class ArtworkReviewDAO extends  BaseDAO<ArtworkReviewDO> {
    @Resource
    private ArtworkReviewMapper artworkReviewMapper;

    @PostConstruct
    public void init(){
        this.mapper = artworkReviewMapper;
    }

    public void deleteByUsernameAndCompetitionId(String username, Integer id) {
        QueryWrapper<ArtworkReviewDO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username",username).eq("id",id);
        artworkReviewMapper.delete(queryWrapper);

    }
}
